/**
 * *****************************************************************
 * @file    adt3102_sagc.h
 * @author  JiangQi(qijiang@andartechs.com.cn)
 * @version 1.0.0
 * @date    2020-04-30
 * @brief   
 *                 Copyright (c) 2020, Andar Technologies Inc.
 *                           www.andartechs.com 
 *
 * *****************************************************************
 */
#ifndef __SAGC__H
#define __SAGC__H

/*------------------------------ include -------------------------------------*/
#include "adt3102_type_define.h"


/*------------------------------ function ------------------------------------*/
/**
 * @brief   software if agc using only one channel input.
 * @param   highGainEn: Set to 1 to make highest tiaGain 3, otherwise 2.
 * @param   srcAddr: If data address. Data arrangement is 16 bit I in lower address and 16bit Q in higher..
 * @param   length: Samples to calculate input amplitute..
 * @param   avgTarget: target output average amplitute for agc. Sinwave ideal average is 4096/pi=1303.
 * @param   pTiaGain~pPgaGain: pointer to tiaGain and pgaGain.
 * @return  None.
 * @note
 */
void sAgc(int16 highGainEn, int32 srcAddr, int16 length, int16 avgTarget, uint32 *pTiaGain, uint32 *pPgaGain);

#endif



